package com.hogae.capital.service.impl;

import java.util.List;
import com.hogae.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hogae.capital.mapper.CapUserWithdrawalAccountMapper;
import com.hogae.capital.domain.CapUserWithdrawalAccount;
import com.hogae.capital.service.ICapUserWithdrawalAccountService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 用户提现账户信息Service业务层处理
 * 
 * @author hogae
 * @date 2021-02-26
 */
@Service
@Transactional(rollbackFor=Exception.class)
public class CapUserWithdrawalAccountServiceImpl implements ICapUserWithdrawalAccountService 
{
    @Autowired
    private CapUserWithdrawalAccountMapper capUserWithdrawalAccountMapper;

    /**
     * 查询用户提现账户信息
     * 
     * @param id 用户提现账户信息ID
     * @return 用户提现账户信息
     */
    @Override
    public CapUserWithdrawalAccount selectCapUserWithdrawalAccountById(Long id)
    {
        return capUserWithdrawalAccountMapper.selectCapUserWithdrawalAccountById(id);
    }

    /**
     * 查询用户提现账户信息列表
     * 
     * @param capUserWithdrawalAccount 用户提现账户信息
     * @return 用户提现账户信息
     */
    @Override
    public List<CapUserWithdrawalAccount> selectCapUserWithdrawalAccountList(CapUserWithdrawalAccount capUserWithdrawalAccount)
    {
        return capUserWithdrawalAccountMapper.selectCapUserWithdrawalAccountList(capUserWithdrawalAccount);
    }

    /**
     * 新增用户提现账户信息
     * 
     * @param capUserWithdrawalAccount 用户提现账户信息
     * @return 结果
     */
    @Override
    public int insertCapUserWithdrawalAccount(CapUserWithdrawalAccount capUserWithdrawalAccount)
    {
        capUserWithdrawalAccount.setCreateTime(DateUtils.getNowDate());
        return capUserWithdrawalAccountMapper.insertCapUserWithdrawalAccount(capUserWithdrawalAccount);
    }

    /**
     * 修改用户提现账户信息
     * 
     * @param capUserWithdrawalAccount 用户提现账户信息
     * @return 结果
     */
    @Override
    public int updateCapUserWithdrawalAccount(CapUserWithdrawalAccount capUserWithdrawalAccount)
    {
        capUserWithdrawalAccount.setUpdateTime(DateUtils.getNowDate());
        return capUserWithdrawalAccountMapper.updateCapUserWithdrawalAccount(capUserWithdrawalAccount);
    }

    /**
     * 批量删除用户提现账户信息
     * 
     * @param ids 需要删除的用户提现账户信息ID
     * @return 结果
     */
    @Override
    public int deleteCapUserWithdrawalAccountByIds(Long[] ids)
    {
        return capUserWithdrawalAccountMapper.deleteCapUserWithdrawalAccountByIds(ids);
    }

    /**
     * 删除用户提现账户信息信息
     * 
     * @param id 用户提现账户信息ID
     * @return 结果
     */
    @Override
    public int deleteCapUserWithdrawalAccountById(Long id)
    {
        return capUserWithdrawalAccountMapper.deleteCapUserWithdrawalAccountById(id);
    }
}
